-
Notifications
You must be signed in to change notification settings - Fork 113
Moved Foundation to AWSLambdaRuntime; AWSLambdaRuntime renamed to AWSLambdaRuntimeCore #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
55b5dd3
to
32de43b
Compare
hey @fabianfett I think the goal of not linking foundation is a good one if we cannot get the performance we need with static linking. I also like the idea of being able to use alternative encoder/decoders, tho overriding encoding/decoding behavior is already possible with the current API, eg:
one idea I did not explore too much and maybe worth looking into is keeping all the the one thing I am not convinced about is separating the modules like this, it does not feel like a good step from a usability point of view. in practice, I believe most/all invocation use-cases will be JSON based (as shown in #35) which means users are most likely always |
5f083ab
to
109176c
Compare
109176c
to
1531d26
Compare
3627846
to
633c829
Compare
@fabianfett as discussed, lets
|
aff9c26
to
09768ec
Compare
@@ -12,6 +12,7 @@ | |||
// | |||
//===----------------------------------------------------------------------===// | |||
|
|||
@_exported import AWSLambdaRuntimeCore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tomerd do we want this here? Use an extra file?
self.run(configuration: configuration, factory: { $0.makeSucceededFuture(handler) }) | ||
} | ||
|
||
// for testing and internal use | ||
@discardableResult | ||
internal static func run(configuration: Configuration = .init(), factory: @escaping (EventLoop) throws -> Handler) -> Result<Int, Error> { | ||
public static func run(configuration: Configuration = .init(), factory: @escaping (EventLoop) throws -> Handler) -> Result<Int, Error> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tomerd we need to pay intention here. This is a change, that I made to make it work fast... But this is needed if we want to be able to test with config for codable as well.
My idea would be to keep this private and really just test the codable closure. Anything else should already be tested by the string tests.
d342138
to
b96da08
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall looks good but i feel we list allot of testing, is that part of the change necessary?
@tomerd Yes, it is either this, or we make these functions public: // for testing and internal use
@discardableResult
internal static func run(configuration: Configuration = .init(), handler: Handler) -> Result<Int, Error> {
self.run(configuration: configuration, factory: { $0.makeSucceededFuture(handler) })
}
// for testing and internal use
@discardableResult
internal static func run(configuration: Configuration = .init(), factory: @escaping (EventLoop) throws -> Handler) -> Result<Int, Error> {
self.run(configuration: configuration, factory: { eventloop -> EventLoopFuture<Handler> in
do {
let handler = try factory(eventloop)
return eventloop.makeSucceededFuture(handler)
} catch {
return eventloop.makeFailedFuture(error)
}
})
} |
b96da08
to
ede1bed
Compare
…LambdaRuntimeCore (#41) motivation: enable non-foundation module for performance sensitive use cases changes: * rename AWSLambdaRuntime to AWSLambdaRuntimeCore * create AWSLambdaRuntime for Foundation dependent functionality * have (new) AWSLambdaRuntime export AWSLambdaRuntimeCore * adjust tests
Motivation
Foundation
fromAWSLambdaRuntime
so thatAWSLambdaRuntime
doesn't linkFoundation
anymorerun
method with theirCodable
implementations. Otherwise custom implementation always need to have a name other thanrun
. Compile error: "Ambiguous use of 'run'"Changes
AWSLambdaRuntimeFoundationCompat
Lambda+Codable
intoAWSLambdaRuntimeFoundationCompat
deadlineDate
toLambda.Context
that returns the deadline as aFoundation.Date
Open ends
@_exported import AWSLambdaRuntime
withinAWSLambdaRuntimeFoundationCompat
? So developers don't have to go:DataLambdaClosure
/DataLambdaHandler
? With this we could eliminate the need to understandByteBuffer
s for less experienced developers.